SELECT ISNULL (cDesc + ' ' + cGroup1 + ' ' + cgroup2,cDesc) FROM supply 

--declare @Desc varchar(20),
--  @g1 varchar(20),
--  @g2 varchar(20)
  
--set @desc = 'q'
--set @g1 = 'a'
--set @g2 = ''

SELECT cSupplyNo AS id,
(isnull(cDesc,'') + 
case when isnull(cDesc,'') <> '' and (isnull(cGroup1,'')<>'' or isnull(cgroup2,'')<>'') then '/' else '' end 
+ isnull(cGroup1,'') + 
case when isnull(cGroup1,'')<>'' and isnull(cgroup2,'')<>'' then '/' else '' end +
isnull(cgroup2,''))AS description FROM supply

ALTER TABLE client_customer ALTER COLUMN cVenCode VARCHAR (25) NULL
UPDATE CLIENT_CUSTOMER SET cConsigneeID = '17-61-02',cVenCode = 'M4367' WHERE cCode = 'SMC'
UPDATE CLIENT_CUSTOMER SET cConsigneeID = '3551',cVenCode = NULL WHERE cCode = 'LNDMRK'

--ALTER TABLE po_t ADD cBarcodeID VARCHAR (25)
--ALTER TABLE po_t ALTER COLUMN cBarcodeID FLOAT
--ALTER TABLE requisitionslip_t ADD cBarcodeID VARCHAR (25)

SELECT * FROM po_t WHERE cPONo = 'PO-100017'
SELECT * FROM requisition WHERE cPRNo = 'PR-100019'

exec erp_sp_RefPRForPO '100-00', ' '


